let nunjucks=require("nunjucks");
function Option(path,opts) {
    path=path||"views"
    opts=opts||{};
    let envopyion={
       
        autosecape:opts.autosecape===undefined?false:opts.autosecape,
        noCache:opts.noCache===undefined?true:opts.noCache,
        

    }
    let Env=nunjucks.configure(path,envopyion)
    return Env;
}
module.exports=async(ctx,next)=>{
     ctx.render=function (views,module) {
         let itme =Option("views")
         ctx.response.body=itme.render(views,module)
         
     }
     await next();
}